package com.j283_5.wisdom_park.controller.confcenter_management.alarules;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.j283_5.wisdom_park.common.result.ResultData;
import com.j283_5.wisdom_park.pojo.Alarules;
import com.j283_5.wisdom_park.pojo.Alarules;
import com.j283_5.wisdom_park.pojo.Orgmanage;
import com.j283_5.wisdom_park.service.AlarulesService;
import com.j283_5.wisdom_park.vo.confcenter_management.AlarulesVo;
import com.j283_5.wisdom_park.vo.confcenter_management.ProjectVo;
import com.j283_5.wisdom_park.vo.confcenter_management.RoleinfoVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/Alarules")
@Api(value = "告警规则",tags = "告警规则",produces = "罗移筵")
public class AlarulesController {
    @Resource
    private AlarulesService alarulesService;

    /**
     * 多条件查询告警规则
     * @param page
     * @param alarules
     * @return
     */
    @RequestMapping(value = "/alaRulesList",method = RequestMethod.GET)
    @ApiOperation(value = "查询所有告警规则",notes = "查询所有告警规则（分页）",produces = "罗移筵",response = ResultData.class)
    public ResultData alaRulesInfo(@Param("page") Page<Alarules> page, Alarules alarules){
        return alarulesService.alaRulesInfo(page,alarules);
    }

    /**
     * 添加告警规则
     * @param alarulesVo
     * @return
     */
    @RequestMapping(value = "/addAlaRules",method = RequestMethod.POST)
    @ApiOperation(value = "添加告警规则",notes = "添加告警规则",produces = "罗移筵",response = ResultData.class)
    public ResultData addAlaRules(@RequestBody AlarulesVo alarulesVo){
        return alarulesService.addAlaRules(alarulesVo);
    }

    /**
     * 删除告警规则
     * @param alaRuleslist
     * @return
     */
    @RequestMapping(value = "/deleteAlaRules",method = RequestMethod.POST)
    @ApiOperation(value = "删除告警规则",notes = "删除告警规则",produces = "罗移筵",response = ResultData.class)
    public ResultData deleteAlaRules(@RequestBody ArrayList<Integer> alaRuleslist){
        return alarulesService.deleteAlaRules(alaRuleslist);
    }

    /**
     * 修改告警规则
     * @param alarules
     * @return
     */
    @RequestMapping(value = "/updateAlaRules",method = RequestMethod.POST)
    @ApiOperation(value = "修改告警规则",notes = "修改告警规则",produces = "罗移筵",response = ResultData.class)
    public ResultData updateAlaRules(@RequestBody Alarules alarules) {
        return alarulesService.updateAlaRules(alarules);
    }
}
